Many electronic devices store program instruction in Flash memory generally in NAND Flash. In particular it is usual to store portions of the initial operational program of the electronic device, known as the “boot code,” in NAND Flash. The boot process usually requires multiple stages. The process generally starts with a read only memory (ROM) boot loader (RBL). Based on the selected boot mode the RBL interfaces with the appropriate storage media such as NAND Flash, MMC, SD and EEPROM. The RBL controls copying the user boot loader (UBL) from the selected non-volatile storage media to device volatile memory. The UBL then begins execution. Generally the UBL copies the application or application kernel image to the device volatile memory and begins the application.
A NAND Flash memory generally includes the following parameters: a device ID; a block size; a page size; and a number of blocks. A NAND Flash memory is often used in the boot process described above. Communication with a NAND Flash requires the communicating device to know the NAND Flash parameters. Knowledge of the block size and the page size are sufficient. Usually this parameter information can be read from the device ID of the NAND Flash memory. An alternative way of getting this information uses a table look up indexed through the device ID of the NAND Flash memory. The boot process can continue once the communicating device obtains the needed parameters. In absence of this parameter information, the communicating device cannot access the NAND Flash memory. In this case boot fails.
If the communicating device can access the NAND Flash memory, the boot process will follow. Copying of UBL to the device volatile memory is controlled by RBL in a multi-step process. The RBL looks for UBL descriptor on Block 0 of page 0 of the NAND Flash memory. The UBL descriptor starts with a fixed magic number (hexadecimal “A1ACED00”) which identifies the UBL descriptor. Any block of the NAND Flash memory can be marked as bad. If the UBL descriptor magic number is not found on block 0 of page 0, the RBL tries to read it from Block 1 of page 0. This search continues until the magic number is found or a predetermined number of reads occurs. The UBL descriptor should reside on Page 0 of the first good block.
The information following the magic number contains the address and length of UBL on the NAND Flash memory. The communicating device uses this information to locate and copy the UBL to device volatile memory. Upon completing this copying, the UBL starts execution and the RBL boot is complete.
There are problems with the conventional boot process. It can be difficult to read the NAND parameters from the NAND device ID during boot time due to lack of standardization among NAND Flash memory manufactures. This may cause boot failure. The NAND Flash memory market is volatile with NAND specifications changing about every 2 years. This makes it difficult for communicating devices to be able to access new generations of NAND Flash memories. This makes it difficult for the original equipment manufacturer (OEM) to obtain suitable NAND Flash memories at the best price. Using a table look up indexed through the device ID doesn't solve this problem. A volatile NAND Flash memory market means a lot of work to keep the table up to date and a lot of memory required to cover all NAND Flash memories. The specification volatility is partly driven by changes in the number of bits allocated to error correcting codes (ECC). Older NAND Flash memories used 8 bits for ECC per 512-byte sector. Some NAND Flash memory manufacturers have a device roadmap requiring a 24-bit ECC with 1024-byte sectors.